<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  class Person{
    constructor(name, age) {
      this.name = name;
      this.age = age;
    }
    changeName(name) {
      console.log("change name to " + name);
    }
  }

  var a = new Person("a", 18);
  var b = new Person("b", 20);
  console.log(a);
  console.log(b);
  a.changeName("aa");
  b.changeName("bb");
</script>
</body>
</html>